home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Conversion / Convert_PICT / Convert PICT.app / UncommentedPSCode / Polygons < prev    next >
Text File  |  1994-05-24  |  1KB  |  103 lines

  1. %BEGIN Polygons
  2. /polyPath
  3. {
  4.     /right    exch def
  5.     /bottom    exch def
  6.     /left    exch def
  7.     /top    exch def
  8.     /points exch def
  9.     newpath
  10.         left top moveto
  11.         right top lineto
  12.         right bottom lineto
  13.         left bottom lineto
  14.     closepath
  15.     clip
  16.     newpath
  17.         /ptarray exch def
  18.         ptarray 0 get
  19.         ptarray 1 get
  20.         moveto
  21.         points 1 sub
  22.         {
  23.             /ptarray exch def
  24.             ptarray 0 get
  25.             ptarray 1 get
  26.             lineto
  27.         }
  28.         repeat    % for (points-1) times
  29. } def
  30. /framePoly
  31. {
  32.     /right    exch def
  33.     /bottom    exch def
  34.     /left    exch def
  35.     /top    exch def
  36.     /points exch def
  37.     gsave
  38.         penPattern usePattern
  39.         /ptarray exch def
  40.         /lastX ptarray 0 get def
  41.         /lastY ptarray 1 get def
  42.         points 1 sub
  43.         {
  44.             /ptarray exch def
  45.             lastX lastY 
  46.             /lastX ptarray 0 get def
  47.             /lastY ptarray 1 get def
  48.             lastX lastY PICTline
  49.         }
  50.         repeat    % for (points-1) times
  51.     grestore
  52. }
  53. def
  54. /paintPoly
  55. {
  56.     gsave
  57.         penPattern usePattern
  58.         polyPath
  59.         fill
  60.     grestore
  61. }
  62. def
  63. /erasePoly
  64. {
  65.     gsave
  66.         backPattern usePattern
  67.         polyPath
  68.         fill
  69.     grestore
  70. }
  71. def
  72. /invertPoly
  73. {
  74.     gsave
  75.         polyPath
  76.     grestore
  77. }
  78. def
  79. /fillPoly
  80. {
  81.     gsave
  82.         fillPattern usePattern
  83.         polyPath
  84.         fill
  85.     grestore
  86. } def
  87. /frameSamePoly
  88.     { }
  89. def
  90. /paintSamePoly
  91.     { }
  92. def
  93. /eraseSamePoly
  94.     { }
  95. def
  96. /invertSamePoly
  97.     { }
  98. def
  99. /fillSamePoly
  100.     { }
  101. def
  102. %END Polygons
  103.